package cn.wen.eeayjoke.refresh;

import android.content.Context;
import android.util.AttributeSet;

import com.scwang.smartrefresh.layout.SmartRefreshLayout;

/**
 * App通用的刷新再次封装
 */

public class AppRefreshLayout extends SmartRefreshLayout {
    public AppRefreshLayout(Context context) {
        this(context, null);
    }

    public AppRefreshLayout(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public AppRefreshLayout(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setHeaderMaxDragRate(7.5f);
        setHeaderTriggerRate(0.6f);//触发刷新距离
        setEnableLoadMore(false);
        setEnableOverScrollBounce(false);
        setEnableOverScrollDrag(false);
    }

    @Override
    public boolean autoRefresh() {
        return super.autoRefresh(100,500,1.0f);
    }
}
